﻿<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::pattern('id', '[0-9]+');
Route::pattern('type', '[a-z]+');
/***************************************注册及登录模块********************************************************/
//Route::get('/', 'Front\IndexController@index');
Route::get('/', 'Front\IndexController@first');
Route::get('/wxstart', 'Front\IndexController@index');//静默跳转登录页面login
Route::get('/login', 'Front\IndexController@login');//实现登录功能，通过接口获取授权码，管理员等信息20181122
Route::get('/jump', 'Front\IndexController@jump');//根据系统初始化状态及用户身份跳转
Route::post('/login', 'Auth\AuthController@postLogin');
Route::get('/logout', 'Auth\AuthController@userLogout');
Route::get('/message', 'Front\IndexController@echoMessage');
Route::post('/message', 'Front\IndexController@postMessage');
Route::get('/message1', 'Front\IndexController@echoMessage1');
Route::get('/xieyi', 'Front\IndexController@xieyi');
Route::get('/moni', 'Front\LoginController@getMoni');//新增模拟登录
Route::get('/xxx', 'Front\LoginController@getXXX');//新增模拟登录

Route::get('/echomsm', 'Front\IndexController@echoMessage1');


Route::controller('/front', 'Front\LoginController');
Route::controller('password', 'Auth\PasswordController');
Route::post('/sendmsg', 'SmsController@sendSms');
Route::controller('/cimo', 'Front\CimoAdminController');





/***********************************************************************************************/
Route::group(array('prefix' => 'admin', 'namespace' => 'Admin'), function () {
/*    Route::get("initialize", "IndexController@index");
    Route::post("initialize", "IndexController@init");
    Route::get("editinit", "IndexController@editinit");
    Route::post("editinit", "IndexController@postEditinit");
    Route::post("logo", "IndexController@postImg");
    Route::resource('group', 'GroupController');//课程分类管理
    //Route::controller("group", "GroupController");
    Route::controller("user", "UserController");
    Route::controller("attendence", "AttendenceController");*/




    Route::resource("init","InitController",['except' => ['show', 'destroy']]);
    Route::post("Upload/companyLogo", "UploadController@companyLogo");

    Route::get("set/company_edit","SetController@companyEdit");
    Route::put("set/company_update","SetController@companyUpdate");
    Route::get("set/attendance_edit","SetController@attendanceEdit");
    Route::put("set/attendance_update","SetController@attendanceUpdate");
    Route::post("set/add-year-set","SetController@postAddYearSet");

    Route::get("cost/standard","CostController@getStandard");
    Route::post("cost/standard-save","CostController@postStandardStore");
    Route::post("cost/standard-del","CostController@postStandardDelete");
    Route::post("cost/month-detail-save","CostController@postMonthDetailStore");
    Route::post("cost/month-detail-delete","CostController@postMonthDetailDelete");
   
    Route::resource("cost", "CostController",['except' => ['create', 'edit']]);//20201124
    Route::post("cost/monthsave","CostController@postMonthStore");
    Route::resource("achievement", "AchievementController",['except' => ['create', 'edit']]);
    Route::get("achievementcheck","AchievementController@check");
    Route::resource("tips","TipsController");
    Route::get("attendance/from", "AttendanceController@ajaxFrom");
    Route::resource("attendance", "AttendanceController",['except' => ['create', 'edit']]);
    Route::post("attendance/check/{id}", "AttendanceController@getDateState");

});

/***********************************************************************************************/
Route::group(array('prefix' => 'user', 'middleware' => 'comcheck',  'namespace' => 'User'), function () {
    Route::controller("performance", "PerformanceController");//个人绩效展示图表页20181120
    Route::get("showTig", "PerformanceController@tig");//个人绩效展示图表页20181120
    Route::controller("message", "MessageController");//消息中心20181120
    Route::controller("reward", "RewardController");//奖励惩罚20181120
    Route::controller("feedback", "FeedbackController");//奖励惩罚20181120
    Route::get("user", "UserController@UserEdit"); //个人头像设置
    Route::get("achievement", "UserController@achievement");
    Route::get("attendance", "UserController@attendance");
    Route::post("userLogo", "UserController@userLogo");
    Route::post("attendance/info", "UserController@ajaxAttendanceInfo");
});

Route::group(array('prefix' => 'sysadmin', 'middleware' => 'comcheck', 'namespace' => 'SysAdmin'), function () {
    Route::controller("permission", "PermissionController");//系统管理员权限管理20181120
    Route::controller("group", "GroupController");//系统管理员分组管理20181120
    Route::controller("user", "UserController");//用户详细信息管理20181120
    Route::controller("feedback", "FeedbackController");//月度意见反馈管理20181120
    Route::controller("reward", "RewardController");//奖惩设置20181120
});


Route::get("pay", "PayController@wechat_native");
Route::get("cashier", "PayController@cashier");
Route::get("wechatbuy", "PayController@wechat_buy");
//微信认真验证
Route::get("oauth_callback", "PayController@oauth_callback");
//确认订单支付信息
Route::post("pay_validate", "WechatController@pay_validate");

//Route::get("add_expiry", "PayController@add_expiry");
//Route::get("oauth_callback", "PayController@oauth_callback");

/***********************************************************************************************/
Route::get('/company-vip', 'PayController@cashier_native');
Route::get('/buy-vip', 'PayController@wechat_native_buy');

Route::post("/wechat_h5_pay", "PayController@wechat_h5_pay");
Route::post("/wechat_native_pay", "PayController@wechat_native_pay");
Route::post("/checkpay", "PayController@pay_check");
/***********************************************************************************************/
//微信授权认证
Route::group(['middleware' => [ 'wechat.oauth:snsapi_userinfo']], function () {

    Route::get("cashier", "PayController@cashier");

    Route::get("wechatbuy", "PayController@wechat_buy");

    Route::get('/wechatuser', function () {
        $user = session('wechat.oauth_user'); // 拿到授权用户资料
        dd($user);
    });
});



